//! 定义了身份类型

/// 身份类型
#[derive(Debug, Clone, PartialEq)]
pub enum Identity {
    /// 未知类型，一般表示出错
    Unknown,

    /// Lord
    ///
    /// 主公
    Lord,

    /// Loyal
    ///
    /// 忠臣
    Loyal,

    /// Rebel
    ///
    /// 反贼
    Rebel,

    /// Traitor
    ///
    /// 内奸
    Traitor,
}

impl Identity {
    /// 判断是不是主公身份
    pub fn is_lord(&self) -> bool {
        Self::Lord.eq(self)
    }
}

impl Default for Identity {
    fn default() -> Self {
        Self::Unknown
    }
}

impl Default for &Identity {
    fn default() -> Self {
        &Identity::Unknown
    }
}
